<%--顾赛男，查询用户并分页出来的结果页面 --%>
<%@page import="com.xz.group12306.business.service.impl.ManagerServiceImpl"%>
<%@page import="com.xz.group12306.business.service.ManagerService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="com.xz.group12306.domain.User" %>
    <%@ page import="java.util.List" %>
     <%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="UTF-8">
    <title>Basic DataGrid - jQuery EasyUI Demo</title>
     <!-- <link rel="stylesheet" type="text/css" href="../js/util/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../js/util/easyui/themes/icon.css">

<script type="text/javascript" src="../js/util/jquery/jquery-3.2.1.min.js"></script> -->
<script type="text/javascript" src="../js/util/easyui/jquery.easyui.min.js"></script>
   
</head>
<body> 
    <table class="easyui-datagrid" title="Basic DataGrid" style="width:700px;height:250px"
       >
     <thead>
            <tr>
                <th data-options="field:'Chance',width:80">选择</th>
                <th data-options="field:'id',width:80">编号</th>
                <th data-options="field:'UserName',width:100">姓名</th>
                <th data-options="field:'sex',width:80,align:'right'">性别</th>
                <th data-options="field:'certType',width:80,align:'right'">证件类型</th>
                <th data-options="field:'cert',width:150">证件号码</th>
                <th data-options="field:'do',width:160,align:'center'">操作</th>
            </tr>
       </thead>   
            <%
             int pageSize = Integer.parseInt(request.getParameter("pageSize"));
     		int start = Integer.parseInt(request.getParameter("start"));

     		String userName = request.getParameter("userName");
     		String sex = request.getParameter("sex");
     		String certType = request.getParameter("certType");
     		String cert = request.getParameter("cert");

     		User user = new User();
     		user.setUsername(userName);
     		user.setSex(sex);

     		user.setCertType(certType);
     		user.setCert(cert);
     		ManagerService managerService=new ManagerServiceImpl();
     		List<User> users = managerService.findUserList(user, start, pageSize);
     		request.setAttribute("users2", users);
             %>
            <%--  <%
               for(User user2:users){
            %>  --%>
        <tbody>
        <c:forEach items="${users2}" var="user"> 
            <tr>
            <td><input type="checkbox" name=""></td>
              
               <td>${user.id}</td>
               <td>${user.username }</td>
                <td>${user.password }</td>
                 <td>${user.certType }</td>
                  <td>${user.cert}</td>
                    <td>
                    	<a href="http://localhost:8080/Our12306/ManageUpdateServlet?id=${user.id}">Update</a>
                    	<a href="http://localhost:8080/Our12306/ManageDelUserServlet?id=${user.id}">delete</a>
            </tr>
            </c:forEach>
            </tbody>
            
            
           
   
    </table>
    

	
    
    
 
</body>
</html>